Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

544
Vistas
¿Cómo eliminar una solicitud en reaccionar axios? [FIJADO]

Hay una lista de notificaciones del backend. Cada notificación tiene un botón de eliminación. Si hago clic en el botón Eliminar de cualquier notificación, quiero que se elimine esa notificación.

¿Cómo hago esto?

mi servicio

 const remove = (notificationDto) => { return new Observable((observer) => { //<NotificationDto> axiosInstance .delete(SERVICE_PATH + '/remove', notificationDto) .then((response) => { observer.next(response.data); observer.complete(); }) .catch((err) => { console.log(err); }); }); };

html

 <div className="notificationlist__container only-desktop"> {props.notification.notificationList.map((notification) => { return ( <div className="notificationlist__time"> {notification.notificationDay} <div className="delete__button"> <AS.IconButton onClick={() => notificationDataUpdateDeleteClick(notification)}> <AS.DeleteIcon /> </AS.IconButton> </div> </div> ); })} </div>

donde llamo al servicio

Después de enviar la notificación como carga útil, el problema se resolvió

 import { InAppNotificationsService } from 'services/InAppNotificationsService'; import { NotificationContext } from 'contexts/NotificationContext'; const { notificationData, setNotificationData } = useContext(NotificationContext); const notificationDataUpdateDeleteClick = (notification) => { InAppNotificationsService.remove({ data: notification }).subscribe({ next: (response) => { InAppNotificationsService.allNotifications({ nationalId: tckn, externalContactNumber: contactInfo?.externalContactNumber }).subscribe({ next: (response) => { setNotificationData(response); }, error: (error) => { console.log(error); } }); }, error: (error) => { console.log(error); } }); };
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda